import java.io.*;
public class Main {	
		String accounter;
		String number;
		float balance;
	public  Main(String x,String y)
	{
		accounter=x;
		number=y;
		balance=0;
	}
	public float Inquire(){      //余额查询
		return balance;
	}

	public void Deposit(float x) {      //存款
		balance=balance+x;
	}
	public void Withdrawal(float x) {   //取款
		balance=balance-x;
	}
	public  static String getChar()
	{
		String s="";
		try{
				BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
				s=in.readLine();
			}catch(IOException e){}
			return s;
	}
	public  static float getNumber()
	{
	    float b;
		String s="";
		try{
				BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
				s=in.readLine();
			}catch(IOException e){}
			b=Float.parseFloat(s);
			return b;
	}
	public static void main(String[] args){
		float c;
		String a,b;	
		a= getChar();
		b= getChar();
		Main m=new Main(a,b);
		System.out.println("存款：");
		System.out.println("请输入存款金额：");
		m.Deposit(getNumber());
		System.out.println("取款：");
		System.out.println("请输入取款金额：");
		while((c=getNumber())>m.balance)
		{
			System.out.println("余额不足，无法取款，请重新输入取款金额：");	
		}
		m.Withdrawal(c);
		System.out.println("余额为：");
		System.out.println(m.Inquire());//静态成员函数里可以通过对象点出非静态的成员
	}
}                                                
